var app=angular.module('dzsw', ['pagination']);//定义模块
app.controller('${entityNameLower}Controller' ,function($scope,$controller,$http){
    $controller('baseController',{$scope:$scope});//继承
    //分页
    $scope.findPage=function(pageNum,pageSize){
        $http.post('../${entityNameLower}/pagelist.do?pageSize='+pageSize+"&pageNum="+pageNum,$scope.searchEntity).success(
            function(response){
                $scope.list=response.rows;
                $scope.paginationConf.totalItems=response.total;//更新总记录数
            }
        );
    }
    $scope.save=function() {
        $http.post('../${entityNameLower}/save.do',$scope.entity).success(
            function(response){
                if(response.success){
                    $scope.reloadList();
                }
            }
        );
    }
    $scope.getById=function (id) {
        $http.get('../${entityNameLower}/getById.do?id='+id).success(
            function(response){
                $scope.entity=response;
            }
        );
    }

    $scope.deletbth=function () {
        if($scope.selectIds.length == 0){
            alert("请选择要删除的数据");
        } else{
            if(confirm("您确认要删除吗？")){
                $http.get('../${entityNameLower}/deletebth.do?ids='+$scope.selectIds).success(
                    function(response){
                        $scope.reloadList();
                    }
                );
            }
        }
    }
});